import Vue from 'vue'
import Vuex from 'vuex'
import fa from "element-ui/src/locale/lang/fa";
import de from "element-ui/src/locale/lang/de";

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        is_loading: false,
        activePath: window.localStorage.getItem("activePath") == null ? "/home" : window.localStorage.getItem("activePath"),
        user: {
            username: "unknow",
            email: 'unknow'
        }
    },
    getters: {},
    mutations: {
        show_loading(state) {
            state.is_loading = true
        },
        hide_loading(state) {
            state.is_loading = false
        },
        SET_ACTIVE_PATH(state, value) {
            state.activePath = value
            window.localStorage.setItem("activePath", value)
        },
        SET_USER(state, value) {
            state.user.username = value
        }
    },
    actions: {},
    modules: {}
})
